package cn.school.student.common.enumdir;

import lombok.Getter;

@Getter
public enum PoliticalAffiliationEnum {

    gongchan("共产党员","0"),
    gong("中共党员","0"),
    yu("中共预备党员","1"),
    qing("共青团员","2"),
    min("民革党员","3"),
    meng("民盟盟员","4"),
    jian("民建会员","5"),
    jin("民进会员","6"),
    nong("农工党党员","7"),
    zhi("致公党党员","8"),
    jiusan("九三学社社员","9"),
    tai("台盟盟员","10"),
    wu("无党派人士","11"),
    qun("群众","12");

    PoliticalAffiliationEnum(String label,String value){
        this.label=label;
        this.value=value;
    }

    private String label;

    private String value;

    //通过label获取对应的枚举实例
    public static PoliticalAffiliationEnum getByLabel(String name) {
        PoliticalAffiliationEnum [] list = values();
        for (PoliticalAffiliationEnum politicalAffiliationEnum : list) {
            if ((politicalAffiliationEnum.label).equals(name)) {
                return politicalAffiliationEnum;
            }
        }
        return null;
    }

}
